import fetch from 'utils/fetch';
/**
 * 校本资源
 */
//分页查询
export function queryMany(page,rows,schoolId,status) {
  const data = {
    page,
    rows,
    schoolId,
    status
  };
  return fetch({
      url: '/material/queryMany',
      method: 'post',
      data
  });
}

// 添加教材
export function save(schoolId, bookName, subjectKey, subjectName,semester,grades,units) {
  const data = {
    schoolId,
    bookName, 
    subjectKey, 
    subjectName,
    semester,
    grades,
    units
  };
  return fetch({
    url: '/material/save',
    method: 'post',
    data
  });
}

// 修改状态(启用/停用)
export function update(bookId) {
  const data = {
    bookId
  };
  return fetch({
    url: '/material/update',
    method: 'post',
    data
  });
}


// 修改教材
export function modify(bookId, bookName, subjectKey, subjectName,semester,grades,units) {
  const data = {
    bookId, 
    bookName, 
    subjectKey, 
    subjectName,
    semester,
    grades,
    units
  };
  return fetch({
    url: '/material/modify',
    method: 'post',
    data
  });
}

// 查询详情
export function queryOne(bookId) {
  const data = {
    bookId, 
  };
  return fetch({
    url: '/material/queryOne',
    method: 'post',
    data
  });
}

// 查询详情
export function listSubjects() {
  return fetch({
    url: 'material/listSubjects',
    method: 'post',
  });
}




